RemotePrinterFS 1.04 (07-Apr-2006)
==================================

Name:     RemotePrinterFS
Purpose:  Module offering printing to printers via TCP/IP protocols
Author:   Stefan Bellon
Requires: RISC OS 3.5 or higher (not sure about RISC OS 3.1)
Status:    Stefan Bellon 2004-2005; see [5] below
WWW:      http://www.sbellon.de/sw-modules.html


Contents
--------
1)   Prologue
1.1) What it does
1.2) Rationale
1.3) Working setups, known bugs and limitations
2)   Installation
2.1) Basic setup
2.2) Setting up the printer path
2.3) Examples
3)   History
4)   Contacting me
5)   Copyright
6)   Eqiloque


1) Prologue
-----------
1.1) What it does

With RemotePrinterFS you can set up !Printers to directly print to a printer
connected to your network (either directly or with a printer box). Currently
two TCP/IP based protocols are supported: JetDirect and LPD/LPRng.

1.2) Rationale

After I 32-bitted Elliott Hughes' JetDirectFS and released it, I noticed that
many people are in need for the LPD/LPR protocol as their printer doesn't
support JetDirect. So I decided to write an implementation from scratch that
could be enhanced with protocols later on. At present, RemotePrinterFS
supports JetDirect and LPD/LPR.

1.3) Working setups, known bugs and limitations

It has been tested with the following hardware/software (of course not with
every possible combination thereof):

* RISC OS versions
  - 4.02
  - 4.37
  - 4.39
  - 5.07
  - 5.08
  - 5.09
  - 5.10

* !Printers(+) versions
  - 1.64a
  - 1.67
  - 1.70
  - 1.71
  - 1.72
  - 1.91a

* Printer
  - Brother HL-2070N
  - HP Color LaserJet 2550 series
  - HP Color LaserJet 5N
  - HP DeskJet 5850
  - HP LaserJet 2015dn
  - HP LaserJet 2100TN
  - HP LaserJet 2200DN
  - HP LaserJet 4550 with JetDirect J3113A card
  - HP LaserJet 4M Plus
  - HP LaserJet 6MP
  - HP LaserJet 6p
  - HP OfficeJet G95
  - Konica-Minolta magicolor 2350
  - Kyocera FS-7000
  - Lexmark Optra S1855
  - Xerox Document Centre 235

* Print Server
  - AXIS PrintPoint 140 BJC         (with Canon BJC-7100)
  - CUPS (Common UNIX Printing System)
  - D-Link DI-704P                  (with HP LaserJet 1100A)
  - DSE 802.11b Print Server USB
  - HP JetDirect 170x
  - HP JetDirect EX Plus3           (with HP LaserJet 1100a and Canon BJC-7100)
  - HP JetDirect EX (J2382B)        (with Apple Laserwriter Select 360)
  - HP JetDirect J2552A             (with HP LaserJet 4M Plus)
  - Intel NetportExpress 10/100     (with HP LaserJet 6MP)
  - LCS-PS300+
  - Lexmark N4000e                  (with Lexmark C510)
  - Netgear Mini Print Server PS101 (with Canon Pixma ip4000)
  - Sercom IP519T                   (with Lexmark Optra S1250)
  - SMC 2804WBRP-G                  (with HP DeskJet 895Cxi)
  - SMC Barricade 7004ABR UK        (with Epson Stylus Color 680)
  - SMC Barricade 7004AWBR EU       (with Epson Stylus Color)
  - SVEC FD2151 Print Server        (with HP LaserJet 5L)

Please give me feedback about your experience with RemotePrinterFS and about
the configuration you run so that I can add it to this document.

If you cannot load RemotePrinterFS from Choices:Boot.PreDesk but get an error message and if you cannot specify the hostname of your printer but only the IP address (see below), then you're likely to run a too old and buggy version of the Shared C Library. Version 5.45 is known to cause those problems, version 5.47 and version 5.50 are known to work.


2) Installation
---------------
2.1) Basic setup

Copy the RPFS directory into Boot:Choices.Boot.PreDesk (or whereever is
appropriate to your setup) and double-click RPFS.!Run or simply reboot if you
are in doubt. Configure !Printers to use a printer definition file suitable
for your printer (in most cases this will be a PostScript printer definition
file or a printer definition file for a printer that understands PCL, but you
might try Gimp-Print definition files as well). In the Connections window
of !Printers, choose to print to a file (don't bother ticking "Append to
file") and enter a path as specified in the following section.

2.2) Setting up the printer path

As filename, you specify a RemotePrinterFS path. The general syntax (a bit
similar to OmniClient's) looks like this:

    RemotePrinterFS#key=value[;key=value...]:

Between the # and the : you can specify key=value pairs separated by
semicolons. There are certain keys that are understood.

Currently there is one mandatory key that has to be present. The key is
"proto" and the value can be one of "JetDirect" or "LPD" and selects which
protocol to use.

The rest of the keys are optional, i.e. they have all default values if
omitted.

Keys for JetDirect:

  key         default           allowed values
  ---         -------           --------------
  host        localhost         any string
  port        9100              any string
  buffer      "no"              "no"/"yes"

Keys for LPD:

  key         default           allowed values
  ---         -------           --------------
  host        localhost         any string
  port        515               any string
  queue       auto              any string
  user        root              any string
  local       <Inet$HostName>   any string
  sendfirst   "controlfile"     "controlfile"/"datafile"
  buffer      "no"              "no"/"yes"
  format      filetype guessing 'c'/'d'/'f'/'g'/'l'/'n'/'o'/'p'/'r'/'t'/'v'
  sendsize    0                 0-2147483647


 Sensible values are either an IP address in dotted quad notation, a
  hostname, or a fully qualified domain name.

 Sensible values are either a port number or a service name (as declared
  in InetDBase:Services).

There exists two aliases: You can write "address" instead of "host" and
the "service" instead of "port".

The key "sendfirst" determines whether the data to be printed or control
information is sent to the printer first. A printer which conforms to the
RFC 1179 (the LPD specification) MUST be able to accept the control file
first, but there are some printers out there who want the data file first,
so I've added that option as well.

For printers following the LPRng specification, you can leave "sendfirst" and
"buffer" on their default value. In this case, no buffering on the disk needs
to be done.
If your printer doesn't follow LPRng, then try turning "buffer=on" and see
whether that helps. In this case, the data will be buffered in
"<Wimp$ScrapDir>.RPFS" before being sent to the printer, thus printing will
be a little bit slower.
If your printer needs to receive the data file before the control file, you
have to specify "sendfirst=datafile". In this case, RemotePrinterFS _has_ to
buffer the data on disk and you don't have any choice. If you specify
"buffer=no" and "sendfirst=datafile", then the data is still buffered on
disk.

With the keyword "format" you can specify how the printer should interpret
the data it got sent. If you're interested to know the meaning of all
11 allowed values, please have a look at RFC 1179, secions 7.17-7.28.
The most interesting are: 'f' for printing formatted text output, 'l' for
printing the data in raw format (i.e. not interpreting it at all) and 'o' for
printing the data as PostScript output. If your printer supports several queues
(like the HP 2550 series), you can control how the printer interprets the data
by specifying the queue as well. If the keyword "format" is omitted,
RemotePrinterFS tries to guess the correct setting based on the filetype
generated by !Printers or the original filetype of the file when dragged to
a RemotePrinterFS filer window. Setting the "format" keyword forces that
setting however.

2.3) Examples
2.3.1) Generic examples

If your printer is called "printer" and is understanding the JetDirect
protocol in default configuration, you should specify:

    RemotePrinterFS#proto=JetDirect;host=printer:

If your printer listens on port 9101 instead, just add the port number:

    RemotePrinterFS#proto=JetDirect;host=printer;port=9101:

If your printer doesn't have a hostname but has the IP address 10.0.0.9, uses
LPD (and follows LPRng), has a printer queue "PS" you want to use, then you
should try:

    RemotePrinterFS#proto=LPD;address=10.0.0.9;queue=PS:

If your printer doesn't follow LPRng, try one of the following two:

    RemotePrinterFS#proto=LPD;address=10.0.0.9;queue=PS;buffer=yes:
    RemotePrinterFS#proto=LPD;address=10.0.0.9;queue=PS;sendfirst=datafile:

If you see the error message "Error in special field" that means that you
made some typo with the above syntax. In this case, take a close look again.
If all fails, just mail me the RemotePrinterFS path you used and I'll have a
look.

2.3.2) Printer specific examples that are known to work

* HP Color LaserJet 2550 series (PostScript Level 2 driver)
* HP LaserJet 2015dn
* HP LaserJet 2100TN (PostScript Level 1 driver)
* HP LaserJet 2200DN
* HP OfficeJet G95 (best fit with HP DeskJet 850C driver)

    RemotePrinterFS#proto=JetDirect;host=<printer>:
    RemotePrinterFS#proto=LPD;host=<printer>:

* Brother HL-2070N (LaserJet-5 driver)
* HP DeskJet 5850
* HP LaserJet 4550 with JetDirect J3113A card
* HP LaserJet 6p
* Konica-Minolta magicolor 2350 (QMS Magicolor 330 driver)
* Kyocera FS-7000

    RemotePrinterFS#proto=JetDirect;host=<printer>:

* Lexmark Optra S1855

    RemotePrinterFS#proto=LPD;host=<printer>;buffer=yes:

* Xerox Document Centre 235

    RemotePrinterFS#proto=LPD;host=<printer>;sendfirst=datafile:

2.3.3) Print server specific examples that are known to work

* AXIS PrintPoint 140 BJC

    RemotePrinterFS#proto=LPD;host=<server>;queue=LPT1:

* CUPS (Common UNIX Printing System) PostScript

    RemotePrinterFS#proto=LPD;host=<server>;queue=<queue>;buffer=yes;format=o:

* CUPS (Common UNIX Printing System) raw data

    RemotePrinterFS#proto=LPD;host=<server>;queue=<queue>;buffer=yes:

* D-Link DI-704P
* SMC Barricade 7004ABR UK

    RemotePrinterFS#proto=LPD;host=<server>;queue=lp;sendfirst=datafile:

* DSE 802.11b Print Server USB

    RemotePrinterFS#proto=LPD;host=<server>;queue=PServer;sendfirst=datafile:

* HP JetDirect 170x
* HP JetDirect EX (J2382B)
* HP JetDirect J2552A
* Netgear Mini Print Server PS101
* Lexmark N4000e

    RemotePrinterFS#proto=JetDirect;host=<server>:

* HP JetDirect EX Plus3

    RemotePrinterFS#proto=JetDirect;host=<server>:
    RemotePrinterFS#proto=JetDirect;host=<server>;port=9101:
    RemotePrinterFS#proto=JetDirect;host=<server>;port=9102:

* Intel NetportExpress 10/100

    RemotePrinterFS#proto=LPD;host=<server>;queue=LPT1_PASSTHRU;sendfirst=datafile:

* LCS-PS300+

    RemotePrinterFS#proto=LPD;host=<server>;queue=lpt1;buffer=yes:

* SMC 2804WBRP-G

    RemotePrinterFS#proto=LPD;host=<server>;queue=lpt1;sendsize=2147483647:

* SMC Barricade 7004AWBR EU

    RemotePrinterFS#proto=LPD;host=<server>;queue=lp;buffer=yes:

* SVEC FD2151 Print Server

    RemotePrinterFS#proto=LPD;host=<server>;sendfirst=datafile:
    RemotePrinterFS#proto=LPD;host=<server>;buffer=yes:

* Sercom IP519T

    RemotePrinterFS#proto=LPD;host=<server>;buffer=yes:


3) History:
-----------
Version 1.04 (07-Apr-2006)
- Added buffer option to JetDirect printing.
- Filetype &000 is not reported in SysLog but treated like Printout data.

Version 1.03 (23-May-2005)
- Added output format guessing based on filetype for LPD.

Version 1.02 (06-Jan-2005)
- Added option sendsize for LPD.
- Try to prevent output of blank sheet of paper at end of LPD print job.

Version 1.01 (09-Dec-2004)
- Fixed bug when using a Gimp-Print driver and LPD.
- Fixed bug when spooling zero length files.

Version 1.00 (18-Nov-2004)
- First official release, identical to beta version 0.10.

Version 0.10 (14-Nov-2004)
- Fix bug introduced in 0.09: First printout after module is loaded may cause
  trouble when using LPD and sendfirst=datafile of buffer=yes.

Version 0.09 (13-Nov-2004)
- Completely rewrote spooling to make it generic for possible future protocols.
- Optimized printing when dragging a file to a RemotePrinterFS filer window.

Version 0.08 (06-Nov-2004)
- Log messages and debug information using SysLog.

Version 0.07 (05-Nov-2004)
- Send correct "data file" name (and not filename!) in the "control file".

Version 0.06 (04-Nov-2004)
- Use "unfiltered printing" instead of "PostScript printing" (see RFC 1179,
  section 7 for details).
- Dragging files to a RemotePrinterFS filer window prints the file now.
- Close accidentally left open spool files.
- Fix transmitted filename string for unbuffered LPD printing.

Version 0.05 (30-Oct-2004)
- Use allocated filing system number and error block.

Version 0.04 (27-Oct-2004)
- Completely reworked error checking.
- Added printer and print server examples to this document.

Version 0.03 (26-Oct-2004)
- Properly implemented RFC 1179 (including correct behaviour when filesize=0
  and "control file first" as well as "data file first").
- Added spooling as this is necessary to properly do RFC 1179.

Version 0.02 (25-Oct-2004)
- Minor fixes here and there.

Version 0.01 (25-Oct-2004)
- First version with JetDirect and LPD.


4) Contacting me
----------------
Stefan Bellon
email: sbellon@sbellon.de
WWW:   http://www.sbellon.de/


5) Copyright
------------
The RemotePrinterFS module and related documentation are  Copyright
2004-2006 by Stefan Bellon. The software is licensed under the GNU GPL,
basically that means that you can get hold of the source code as well
and that you're free to modify it to your likes, but when you distribute
binaries you have to release the source code as well. You can find the
GNU GPL in the file COPYING which is included in this distribution.


6) Epilogue
-----------
I'd like to hear about your experiences with RemotePrinterFS. So, please give
me feedback, positive feedback as well as negative one.

At this point I'd like to thank my beta testers for their patience and the
good cooperation (in random order): Evan Clark, Leon Neelen, Michael Hambley,
Rien Mertens, Alan Glover and John Sandford.